import { PluginFunction } from 'vue'
import { extend } from './extend';
import { mixinOptions } from './mixin';



interface Install extends PluginFunction<any> {
    installed?: boolean;
}

export const install: Install = (Vue, options = {}) => {

    if (process.env.NODE_ENV !== 'production' && install.installed) {
        console.warn('already installed.')
        return
      }
      install.installed = true

      // 扩展 Vue.prototype
      extend(Vue)
      Vue.mixin(mixinOptions)
}